#include "FITKOFMeshReaderFASTSIM.h"
#include "FITK_Interface/FITKInterfaceMesh/FITKUnstructuredMeshVTK.h"
#include "FITK_Kernel/FITKAppFramework/FITKAppFramework.h"
#include "FITK_Kernel/FITKAppFramework/FITKGlobalData.h"
#include "FITKOrdinaryMeshReaderFASTSIM.h"
#include <qcoreapplication.h>
#include <qdebug.h>

namespace IO {

    QString FITKOFMeshReaderFASTSIM::getComponentName()
    {
        return "IO::FITKOFMeshReaderFASTSIM";
    }

    bool FITKOFMeshReaderFASTSIM::exec(const int indexPort)
    {
        if (m_Folder.isEmpty() || m_Mesh == nullptr) return false;
        // 读取网格
        IO::FITKOrdinaryMeshReaderFASTSIM OrdinaryMeshReader;
        OrdinaryMeshReader.setFileName(m_Folder);
        OrdinaryMeshReader.setDataObject(m_Mesh);
        return OrdinaryMeshReader.read();
    }

    void FITKOFMeshReaderFASTSIM::setMeshFolder(QString folder)
    {
        m_Folder = folder;
    }

    void FITKOFMeshReaderFASTSIM::setMeshObj(Interface::FITKUnstructuredMeshVTK* mesh)
    {
        m_Mesh = mesh;
    }

}


